package com.alveole.objects;

import javax.enterprise.context.SessionScoped;

import com.alveole.dao.User;


@SessionScoped
public class BrowserSession implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1950451965355580950L;
	private boolean authenticated=false;
	private User user;
		
	private static long AnonymousCount=0;
	
	public BrowserSession() {
		super();
		this.authenticated = false;
	}


	public User getUser() {
		if (user==null)
		{
			user=new User("Anonymous" + AnonymousCount,null);
			AnonymousCount++;
		}
		return user;
	}


	public void setUser(User user) {
		this.user = user;
	}

	public boolean isAuthenticated() {
		return authenticated;
	}
	public void setAuthenticated(boolean authenticated) {
		this.authenticated = authenticated;
	}
}
